{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Interactive visualization of MPI simulaitons\n", "\n", "In this example, which builds on our previous one of interactive MPI monitoring, we now demonstrate how to use the IPython data publication APIs.\n", "\n", "\n", "\n", "## Load IPython support for working with MPI tasks\n", "\n", "First, we create a cluster using `mpi` to launch the engines.\n", "This launches the engines using `mpiexec` so they are in the same mpi universe.\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using existing profile dir: '/Users/minrk/.ipython/profile_default'\n", "Starting 4 engines with \n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "da09992ca3fd438eadf96a6599d5384e", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/4 [00:00" ] }, "metadata": { "image/png": { "height": 365, "width": 572 } }, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Simulation completed!\n", "Monitored for: 0:00:11.457755.\n" ] } ], "source": [ "monitor_simulation(ar, refresh=1)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.6" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { "31b6b4a0105148e187aadfc70e0fe1c7": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_c872eb3aedc4492eb5a7d3b3c24249bb", "style": "IPY_MODEL_7b50ee6a201f48f796c337a68ba8730c", "value": " 4/4 [00:05<00:00, 5.23s/engine]" } }, "401e2a9344964c7082435def275db2c8": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": {} }, "650e652f16044e4f816006c8f334eadb": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_9a56d508e10842299d798de5d18aa84a", "style": "IPY_MODEL_fe5f5baeb0b24e13bfb0aa8e3d411b0b", "value": "100%" } }, "7b50ee6a201f48f796c337a68ba8730c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "description_width": "" } }, "7d5e98d4de4b472080ce751a65546968": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "bar_style": "success", "layout": "IPY_MODEL_401e2a9344964c7082435def275db2c8", "max": 4, "style": "IPY_MODEL_a577270a23bf46fa933a41e32d1a5a79", "value": 4 } }, "9a56d508e10842299d798de5d18aa84a": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": {} }, "a577270a23bf46fa933a41e32d1a5a79": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "description_width": "" } }, "bba28e827ace46e9b233476330b76938": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": {} }, "c872eb3aedc4492eb5a7d3b3c24249bb": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": {} }, "da09992ca3fd438eadf96a6599d5384e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "children": [ "IPY_MODEL_650e652f16044e4f816006c8f334eadb", "IPY_MODEL_7d5e98d4de4b472080ce751a65546968", "IPY_MODEL_31b6b4a0105148e187aadfc70e0fe1c7" ], "layout": "IPY_MODEL_bba28e827ace46e9b233476330b76938" } }, "fe5f5baeb0b24e13bfb0aa8e3d411b0b": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "description_width": "" } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }